const router = require('koa-router')()

router.get('/', async (ctx, next) => {
  let sql = 'select * from user where name=? and telephone=?'

  let res = await ctx.db.EXECUTE(sql,['放到数据库',1234325])

  ctx.body = res
})

router.get('/string', async (ctx, next) => {
  ctx.body = 'koa2 string'
})

router.get('/json', async (ctx, next) => {
  ctx.body = {
    title: 'koa2 json'
  }
})

module.exports = router
